package com.supinfo.youfood.pages.user.add;

import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.model.CompoundPropertyModel;
import org.apache.wicket.model.LoadableDetachableModel;

import com.supinfo.food.entities.User;
import com.supinfo.youfood.forms.AddUserForm;
import com.supinfo.youfood.template.Template;

/**
 * Ajout d'un utilisateur
 * @author Keitaro
 */
public class UserAdd extends Template {

	public UserAdd() {
		formManager();
	}
	
	/**
	 * Gestion du formulaire
	 */
	@SuppressWarnings("rawtypes")
	private void	formManager() {
		Form form = new AddUserForm("addUserForm", new CompoundPropertyModel(new LoadableDetachableModel() {
			private static final long serialVersionUID = 1L;
			@Override
			protected Object load() {
				return new User();
			}
		}));
		add(form);
	}
}
